package com.et.machine.convert

import com.et.drive.info.*
import com.et.drive.out.CashSelection
import com.et.drive.out.OutGoodsParam
import com.et.drive.out.OutResult

data class InitParams(val name: String, val port: Int)

/**
 * function of initiation
 */
interface Inlet {
    fun init(param: InitParams)
    fun exit()
}

/**
 * result of send command
 */
enum class OutGoodsStatusEnum {
    FAILED, SUCCESS, BUSY
}

/**
 * Send Goods command and back result
 */
interface IOutGoods {
    fun outGoods(param: OutGoodsParam): OutGoodsStatusEnum
    fun subscribe(_callback: (OutResult) -> Unit)
}

/**
 * Get machine information
 */
interface IMachineSignInfo {
    fun observer(_callback: (MachineInfo) -> Unit)
}

interface IChannelInfo {
    fun channelInfoSubscribe(_callback: (ChannelInfo) -> Unit)
    fun channelGoodsIdSubscribe(_callback: (ChannelGoodsID) -> Unit)
    fun channelPriceSubscribe(_callback: (ChannelPrice) -> Unit)
}

interface ICashSelection {
    fun subscribe(_callback: (CashSelection) -> Unit)
}

interface ILightTemperature {
    fun subscribe(_callback: (LightTemperatureInfo) -> Unit)
}


interface IMachineOperationInfo {
    fun subscribe(_callback: (MachineOperationInfo) -> Unit)
}

interface IMachineIdInfo {
    fun observer(_callback: (MachineIdInfo) -> Unit)
}

interface IDeviceStatus


